#pragma once
#include "DXAMLCommon.h"

#include "CDependencyObject.h"
#include "AutomationProperties.h"

#include "ContentRenderData.h"
#include "PropertyRenderData.h"

#include "CRasterizerEdgeStore.h"
class CTransitionRoot;
class CHitTestResults;
class HWShapeRealization;
class CPerspectiveTransformer;
class CTransform;
class CPointer;
class CGeneralTransform;
class CMILMatrix;
class CTransitionTarget;
class CLayoutTransitionElement;
class CLayer;
class CUIElementCollection;
class CAggregateTransformer;
class CCompositeVectorBuffer;
class HWRealization;
class CCoreServices;
class CRenderTarget;
class CProjection;
class CGeometry;
class CPointerCollection;
class HWInstance;
struct PopupParentProjectionData;
class TransformAndClipStack;
class CInputManager;
class CImageBrush;
class LayoutTransitionStorage;
class CLayoutStorage;
struct REQUEST;
class CTriggerCollection;
class CCacheMode;
class CBrush;
class CRasterizerPath;
class HWCompTreeNode;
class CTransitionCollection;
class CCollection;
class HitTestPolygon;
class CSolidColorBrush;
class CStyle;

class CUIElement :
	public CDependencyObject
{
protected: 
	CUIElement(CCoreServices * pCore);
protected: 
	CUIElement();
public: 
	virtual ~CUIElement();
private: 
	void Initialize();
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
protected: 
	virtual XBOOL CanEnterImpl(CDependencyObject * pNamescopeOwner);
	virtual HRESULT EnterImpl(CDependencyObject * pNamescopeOwner, struct EnterParams params);
	virtual HRESULT LeaveImpl(CDependencyObject * pNamescopeOwner, struct LeaveParams params);
	virtual HRESULT MarkInheritedPropertyDirty(CDependencyProperty * pdp, CValue * pValue);
public: 
	virtual void PropagateLayoutDirty(XUINT32 affectsParentMeasure, XUINT32 affectsParentArrange);
	virtual XUINT32 GetTypeIndex() const;
	virtual HRESULT GetValue(CDependencyProperty * pdp, CValue * pValue);
	virtual HRESULT SetValue(CDependencyProperty * pdp, CValue * pValue);
	virtual HRESULT ClearValue(CDependencyProperty * pdp);
	virtual HRESULT PullInheritedTextFormatting();
	HRESULT Notify(enum XCHILDNOTIFY);
	virtual HRESULT HasProtectedContent(XBOOL * pfHasProtectedContent);
	virtual HRESULT AddEventListener(CDependencyProperty * pdp, CValue * pValue, XINT32 iListenerType, CValue * pResult, XINT32 fHandledEventsToo);
	virtual HRESULT RemoveEventListener(CDependencyProperty * pdp, CValue * pValue);
	HRESULT RemoveAllEventListeners();
	HRESULT GetLocalTransitionRoot(CTransitionRoot * * ppTransitionRoot, XBOOL ensureTransitionRoot);
	virtual HRESULT AddChild(CUIElement * pChild);
	virtual HRESULT RemoveChild(CUIElement * pChild);
	void SetLayoutClipDirty();
	XBOOL IsInUIElementsVisualSubTree(CUIElement *);
	XBOOL IsInUIElementsAdjustedVisualSubTree(CUIElement * pPotentialParentOrSelf);
	HRESULT HitTestEntry(const struct XRECTF_WH & hitRect, CHitTestResults * pHitElements, struct XPOINTF * pptHitRect, XBOOL fHitMultiple);
	HRESULT HitTestEntry(struct XPOINTF hitPoint, CHitTestResults * pHitElements, XBOOL fHitMultiple);
	HRESULT HitTestEntry(struct XPOINTF hitPoint, CUIElement * * ppHitElement);
	XBOOL IsEnabledAndVisibleForHitTest();
	virtual XBOOL IsMaskDirty(HWShapeRealization * pHwShapeRealization);
private: 
	HRESULT NWGetTransformerHelper(CPerspectiveTransformer * * ppTransformer3D);
public: 
	virtual HRESULT GetBoundingRectangle(struct XRECTF_WH * pRect);
	virtual HRESULT GetClickablePoint(struct XPOINTF * pPoint);
	HRESULT AdjustBoundingRectToRoot(struct XRECTF_WH * pRect);
	HRESULT AdjustBoundingRectFromChildToParent(struct XRECTF_WH * pRect);
	CUIElement * GetFirstAncestorWithIntermediate();
	CUIElement * GetUIElementAdjustedParentInternal(XBOOL fPublicParentsOnly);
	XBOOL IsVisible() const;
	XBOOL IsCollapsed() const;
	enum Visibility GetVisibility();
	void SetVisibility(enum Visibility value);
	XBOOL AreAllAncestorsVisible();
	XFLOAT GetOpacityLocal();
	void SetOpacityLocal(XFLOAT value);
	XFLOAT GetOpacityCombined();
	CTransform * GetRenderTransformLocal();
	void SetRendertransformLocal(CTransform *);
	XBOOL NeedsIntermediateRendering();
	static HRESULT ZIndex(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	HRESULT CapturePointer(CPointer * pPointer, XBOOL * pbCapture);
	HRESULT ReleasePointerCapture(CPointer * pPointer);
	HRESULT ReleasePointerCaptures();
	HRESULT TransformToVisual(CUIElement * pVisual, CGeneralTransform * * ppReturnValue);
	HRESULT TransformToAncestor(CUIElement * pAncestor, struct ITransformer * * ppTransformer);
	HRESULT TransformToRoot(struct ITransformer * * ppTransformer);
	HRESULT TransformToParentWithIntermediate(struct ITransformer * * ppTransformer);
	virtual HRESULT GetTransformer(struct ITransformer * * ppTransformer);
	virtual void GetShouldFlipRTL(XBOOL * pShouldFlipRTL, XBOOL * pShouldFlipRTLInPlace);
	static XUINT32 GetLocalTransform(XFLOAT offsetX, XFLOAT offsetY, XFLOAT dmOffsetX, XFLOAT dmOffsetY, XFLOAT dmZoomFactor, XBOOL flipRTL, XBOOL flipRTLInPlace, XFLOAT elementWidth, XFLOAT elementHeight, CTransform * pRenderTransform, struct XPOINTF renderTransformOrigin, CTransitionTarget * pTransitionTarget, CMILMatrix * pLocalTransform);
	XUINT32 GetLocalTransform(CMILMatrix * pLocalTransform, XBOOL fIncludeOffset);
	HRESULT PushTransform(XINT32 *);
	XINT32 GetZIndex() const;
	HRESULT SetZIndex(XINT32 zIndex);
	XBOOL IsDrawOrderSmallerThan(CUIElement * pOther) const;
	HRESULT OnZOrderChanged();
	HRESULT GetUnsortedChildren(XUINT32 & count, CUIElement * * & pChildren);
	virtual struct Xcp_IAutomationPeer * OnCreateAutomationPeer();
	virtual struct Xcp_IAutomationPeer * GetAutomationPeer();
	virtual HRESULT SetAutomationPeer(struct Xcp_IAutomationPeer * pAP);
	virtual struct Xcp_IAutomationPeer * OnCreateAutomationPeerImpl();
	XUINT32 GetAPChildrenCount();
	virtual XUINT32 GetAPChildren(struct Xcp_IAutomationPeer * * * pppReturnAP);
	virtual struct Xcp_IAutomationPeer * GetPopupAssociatedAutomationPeer();
	static HRESULT HitTestVisible(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	static HRESULT AllowDrop(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	XBOOL IsTapEnabled() const;
	static HRESULT IsTapEnabled(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	XBOOL IsDoubleTapEnabled() const;
	static HRESULT IsDoubleTapEnabled(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	XBOOL IsRightTapEnabled() const;
	static HRESULT IsRightTapEnabled(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	XBOOL IsHoldEnabled() const;
	static HRESULT IsHoldEnabled(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	static HRESULT UseLayoutRounding(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	virtual HRESULT CoerceIsEnabled(XBOOL bIsEnabled, XBOOL bCoerceChildren);
	virtual HRESULT RaiseIsEnabledChangedEvent(CValue * pValue);
	static HRESULT VisibilityState(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	virtual XFLOAT GetActualWidth();
	virtual XFLOAT GetActualHeight();
	HRESULT AddLayoutTransitionRenderer(CLayoutTransitionElement * pLayoutTransitionElement);
	HRESULT RemoveLayoutTransitionRenderer(CLayoutTransitionElement * pLayoutTransitionElement);
	XBOOL HasAbsolutelyPositionedLayoutTransitionRenderers();
	HRESULT RemoveAbsolutelyPositionedLayoutTransitionRenderers();
	XBOOL IsHitTestVisible() const;
	XBOOL AllowsDrop() const;
	XBOOL IsEnabled() const;
	XBOOL GetIsEnabled() const;
	void SetIsEnabled(XBOOL fIsEnabled);
	virtual XBOOL GetCoercedIsEnabled();
	void SetCoercedIsEnabled(XBOOL fIsEnabled);
	void SetUseLayoutRounding(XBOOL fUseLayoutRounding);
	virtual XBOOL GetUseLayoutRounding();
	void SetSkipFocusSubtree(XBOOL skipFocusSubtree);
	XBOOL SkipFocusSubtree();
	virtual TextFormatting * * GetTextFormattingMember();
	virtual XINT32 HasInheritedProperties();
	virtual void EvaluateIsRightToLeft();
	virtual XBOOL IsRightToLeft();
	void LockParent();
	void UnlockParent();
	virtual XBOOL Focus(enum FocusState focusState);
	virtual XBOOL IsFocused();
	virtual HRESULT UpdateFocusState(enum FocusState focusState);
	virtual XBOOL IsFocusable();
	virtual XBOOL ShouldRender();
	XBOOL ShouldAddEdges(CLayer *);
	HRESULT CheckAutomaticAutomationChanges();
	HRESULT EnsureAutomationProperties(XBOOL fDefaultOK);
	static HRESULT EnsureAutomationProperties(CDependencyObject * pObject, CDependencyProperty * pDp, XBOOL forGetValue);
	virtual HRESULT UpdateImplicitStyle(CStyle * pOldStyle, CStyle * pNewStyle, XBOOL bForceUpdate, XBOOL bUpdateChildren, XBOOL isLeavingParentStyle);

private: 
	typedef XUINT32 (__thiscall *PFNGetFn)(CUIElement *pthis);
	typedef void (__thiscall *PFNSetFn)(CUIElement *pthis, XUINT32);
	static HRESULT GetOrSetBitfield(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, PFNGetFn  * pGetFn, PFNSetFn  * pSetFn, CValue * pResult);
	XBOOL GetIsHitTestVisible() const;
	void SetIsHitTestVisible(XBOOL fIsHitTestVisible);
	XBOOL GetAllowDrop() const;
	void SetAllowDrop(XBOOL fAllowDrop);
	XBOOL GetIsTapEnabled() const;
	void SetIsTapEnabled(XBOOL isTapEnabled);
	XBOOL GetIsDoubleTapEnabled() const;
	void SetIsDoubleTapEnabled(XBOOL isDoubleTapEnabled);
	XBOOL GetIsRightTapEnabled() const;
	void SetIsRightTapEnabled(XBOOL isRightTapEnabled);
	XBOOL GetIsHoldEnabled() const;
	void SetIsHoldEnabled(XBOOL isHoldEnabled);
	XBOOL IsHiddenForLayoutTransition() const;
	HRESULT GetTransformToAncestorCommon(CUIElement * pAncestor, XBOOL fPublicParentsOnly, XBOOL fStopAtParentWithIntermediate, struct ITransformer * * ppTransformer);
	HRESULT PushUseLayoutRounding(XUINT32 fUseLayoutRounding);
	XUINT32 GetAPPopupChildrenCount();
	XUINT32 AppendAPPopupChildren(XUINT32 nCount, struct Xcp_IAutomationPeer * * ppChildrenAP);
	XUINT32 GetAPPopupChildren(XUINT32 nCount, struct Xcp_IAutomationPeer * * ppChildrenAP);
	HRESULT CoerceIsEnabledOnVisualChildren(XBOOL fIsEnabled);
	HRESULT EnsureChildrenCollection();
	HRESULT CreateChildrenCollection(CUIElementCollection * * ppChildrenCollection);
protected: 
	HRESULT HasFocusedElement(XBOOL * pbHasFocusedControl);
	virtual XUINT32 IgnoresInheritedClips();
	static HRESULT AggregateElementTransform(CUIElement * pElement, CAggregateTransformer * pAggregate);
	static const struct AutomationProperties DefaultAutomationProperties;

public: 
	virtual XINT32 CanHaveChildren();
	CCollection * GetChildren();
	static HRESULT GetChildren(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	static HRESULT GetChildrenInternal(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	virtual XBOOL ParticipatesInManagedTreeInternal();
	virtual CUIElement * GetFirstChildNoAddRef();
	virtual CUIElement * GetFirstChild();
	virtual XBOOL AreChildrenInLogicalTree();
	HRESULT InvalidateSubTree(XINT32);
	HRESULT HasCycle(XUINT32 *);
	virtual void Shutdown();
	virtual HRESULT GetChildrenInRenderOrder(CUIElement * * * pppUIElements, XUINT32 * puiChildCount);
	XBOOL HasActiveProjection();
	static HRESULT AddPaddingPathCommon(CCoreServices *, CRasterizerPath * *, CCompositeVectorBuffer *, XUINT32, struct XRECTF_RB *);
	HRESULT GetForegroundBrush(XBOOL * pHasForegroundProperty, CBrush * * ppForegroundBrush);
protected: 
	XUINT32 SoftwareAppliedOpacity();
	HRESULT CalculateTransformsForIntermediate(CMILMatrix *, CMILMatrix *, CMILMatrix *, XUINT32);
	HRESULT CalculateRTITransform(CMILMatrix *, XUINT32);
	enum LayoutFlags
	{
		LF_MEASURE_DIRTY = 0x1,
		LF_MEASURE_DIRTY_PENDING = 0x2,
		LF_ON_MEASURE_DIRTY_PATH = 0x4,
		LF_ON_MEASURE_STACK = 0x8,
		LF_ARRANGE_DIRTY = 0x10,
		LF_ARRANGE_DIRTY_PENDING = 0x20,
		LF_ON_ARRANGE_DIRTY_PATH = 0x40,
		LF_ON_ARRANGE_STACK = 0x80,
		LF_HAS_BEEN_MEASURED = 0x100,
		LF_ANCESTOR_DIRTY = 0x200,
		LF_MEASURE_DURING_ARRANGE = 0x400,
		LF_REQUIRES_CLIP = 0x800,
		LF_SIZE_CHANGED = 0x1000,
		LF_WANTS_SIZE_CHANGED = 0x2000,
		LF_WANTS_LAYOUT_UPDATED = 0x4000,
		LF_LAYOUTTRANSITION_DIRTY = 0x10000,
		LF_LAYOUTTRANSITION_DIRTY_PENDING = 0x20000,
		LF_ON_LAYOUTTRANSITION_DIRTY_PATH = 0x40000,
		LF_ON_LAYOUTTRANSITION_STACK = 0x80000,
		LF_AUTOMATION_PEER_DIRTY = 0x10000000,
		LF_ON_AUTOMATION_PEER_DIRTY_PATH = 0x40000000
	};

private: 
	static const XUINT32 LF_EXPECTED_EVENTS;
	XUINT32 GetLayoutFlagsOr(XUINT32 flags);
	XUINT32 GetLayoutFlagsAnd(XUINT32 flags);
	void SetLayoutFlags(XUINT32 flags, XUINT32 value);
public: 
	XBOOL GetLayoutFlagsRaw();
	virtual XBOOL GetIsLayoutElement();
	XBOOL GetIsParentLayoutElement();
	XBOOL GetIsMeasureDirty();
	void SetIsMeasureDirty(XBOOL value);
	XBOOL GetIsMeasureDirtyPending();
	void SetIsMeasureDirtyPending(XBOOL value);
	XBOOL GetIsOnMeasureDirtyPath();
	void SetIsOnMeasureDirtyPath(XBOOL value);
	XBOOL GetIsOnMeasureStack();
	void SetIsOnMeasureStack(XBOOL value);
	XBOOL GetHasBeenMeasured();
	void SetHasBeenMeasured(XBOOL value);
	XBOOL GetIsArrangeDirty();
	void SetIsArrangeDirty(XBOOL value);
	XBOOL GetIsArrangeDirtyPending();
	void SetIsArrangeDirtyPending(XBOOL value);
	XBOOL GetIsOnArrangeDirtyPath();
	void SetIsOnArrangeDirtyPath(XBOOL value);
	XBOOL GetIsOnArrangeStack();
	void SetIsOnArrangeStack(XBOOL value);
	XBOOL GetIsAncestorDirty();
	void SetIsAncestorDirty(XBOOL value);
	XBOOL GetIsMeasureDuringArrange();
	void SetIsMeasureDuringArrange(XBOOL value);
	XBOOL GetRequiresClip();
	void SetRequiresClip(XBOOL value);
	XBOOL GetSizeChanged();
	void SetSizeChanged(XBOOL);
	XBOOL GetIsAutomationPeerDirty();
	void SetIsAutomationPeerDirty(XBOOL value);
	XBOOL GetIsOnAutomationPeerDirtyPath();
	void SetIsOnAutomationPeerDirtyPath(XBOOL value);
	XBOOL HasLayoutStorage();
	XBOOL HasLayoutClip();
	XBOOL GetRequiresMeasure();
	XBOOL GetRequiresArrange();
	XBOOL GetRequiresLayout();
	XBOOL GetIsLayoutSuspended();
	void SetWantsSizeChanged(XBOOL value);
	XBOOL GetWantsSizeChanged();
	void SetWantsLayoutUpdated(XBOOL);
	XBOOL GetWantsLayoutUpdated();
	void SetLayoutStorage(CLayoutStorage *);
	CLayoutStorage * GetLayoutStorage();
	HRESULT EnsureLayoutStorage();
	static HRESULT GetRenderSize(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * ppArgs, CValue * pResult);
	virtual XFLOAT GetActualOffsetX();
	virtual XFLOAT GetActualOffsetY();
	HRESULT Measure(struct XSIZEF availableSize);
	HRESULT Arrange(struct XRECTF_WH finalRect);
	HRESULT InvalidateMeasure();
	HRESULT InvalidateArrange();
	HRESULT UpdateLayout();
	virtual void OnChildDesiredSizeChanged(CUIElement * child);
	struct XRECTF_WH GetProperArrangeRect(struct XRECTF_WH parentFinalRect);
	CDependencyObject * GetRootOfPopupSubTree();
	HRESULT BringIntoView(struct XRECTF_WH rectangle, XBOOL forceIntoView);
	HRESULT BringIntoView();
	virtual CDependencyObject * GetLogicalParent();
	virtual HRESULT UpdateLayoutClip(XBOOL forceClipToRenderSize);
	HRESULT LayoutRound(XFLOAT value, XFLOAT * returnValue);
	XFLOAT LayoutRound(XFLOAT value);
protected: 
	virtual HRESULT MeasureCore(struct XSIZEF availableSize, struct XSIZEF & desiredSize);
	virtual HRESULT ArrangeCore(struct XRECTF_WH finalRect);
	XBOOL IsSameSize(struct XSIZEF & size1, struct XSIZEF & size2);
	XBOOL IsSameRect(struct XRECTF_WH & r1, struct XRECTF_WH & r2);
private: 
	HRESULT MeasureInternal(struct XSIZEF availableSize);
	HRESULT ArrangeInternal(struct XRECTF_WH finalRect);
	void InvalidateMeasureInternal();
	void InvalidateArrangeInternal();
	void InvalidateAutomationPeerDataInternal();
	void PropagateOnMeasureDirtyPath();
	void PropagateOnArrangeDirtyPath();
	void PropagateOnAutomationPeerDirtyPath();
	void PropagateAncestorDirty(CUIElement * pDirtyAncestor);
	void PropagateOnPathInternal(XBOOL pathFlag, XBOOL dirtyFlag, XBOOL pendingFlag);
	void ResetLayoutInformation();
	HRESULT RaiseRequestBringIntoViewEvent(struct XRECTF_WH rectangle, XBOOL forceIntoView);
	void SetChildRenderOrderDirty();
public: 
	HRESULT NWRender(const struct SharedRenderParams & parentSharedRP, const struct NWRenderParams & parentNWRP);
	HRESULT NWCleanDirtyFlagsRecursive();
	static void NWSetVisibilityDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetTransformDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetProjectionDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetClipDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetOpacityDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetCacheModeDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetContentDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetContentAndBoundsDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetSubgraphDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetTransitionTargetDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetHasTransformAnimationDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetHasOpacityAnimationDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	static void NWSetHasCompositionNodeDirty(CDependencyObject * pTarget, enum DirtyFlags::Value flags);
	void NWComputeElementSize(CCompositeVectorBuffer * pIntermediateVectorBuffer, struct XSIZEF * pElementSize);
	HRESULT GetElementSizeForProjection(struct XSIZEF * pElementSize);
	virtual void NotifyParentChange(CDependencyObject * pNewParent, PFNParentRenderChangedHandler  * pfnNewParentRenderChangedHandler);
	static void NWComputeProjectionQuadPadding(XINT32 quadOffsetX, XINT32 quadOffsetY, XINT32 quadWidth, XINT32 quadHeight, const struct XSIZEF * pElementSize, struct XRECTF_RB * pQuadPadding);
	XBOOL NWNeedsRendering();
	virtual XBOOL NWSkipRendering();
public: 

	HRESULT NWUpdateTransformsAndProjectionsToRoot(XBOOL fRequestUpdate, xvector<PopupParentProjectionData *> * pParentProjectionData, CMILMatrix * pOriginToSurfaceTransform, XBOOL * pUpdatedTransforms, XBOOL * pAreAllAncestorsVisible, XFLOAT * pOpacity);
	HRESULT GetRedirectionTransformsAndParentCompNode(CRenderTarget * pRenderTarget, TransformAndClipStack * pTransformsToParentCompNode, CMILMatrix * pTransformToRoot, XBOOL * pIsTransformToRootAnimating, XBOOL * pAreAllAncestorsVisible, HWCompTreeNode * * ppNearestCompNode);
	static HRESULT NWCreateVectorBuffer(CRenderTarget * pRenderTarget, enum PixelFormat pixelFormat, CCompositeVectorBuffer * * ppVectorBuffer);
	HRESULT NWRenderTransformed(struct SharedRenderParams & mySharedRP, struct NWRenderParams & myNWRP);
	HRESULT NWRenderTransformedContent(struct SharedRenderParams & mySharedRP, struct NWRenderParams & myNWRP);
	HRESULT D2DComputeBounds(const struct D2DRenderParams &);
	HRESULT D2DRenderTransformed(struct SharedRenderParams &, const struct D2DRenderParams &);
	HRESULT D2DRenderTransformedContent(struct SharedRenderParams &, const struct D2DRenderParams &);
	HRESULT D2DPreRender(struct IPALAcceleratedGraphicsFactory * pD2DFactory, const CMILMatrix * pRootTransform, struct XRECT_WH * pSubtreeBounds);
	HRESULT D2DRender(const CMILMatrix * pRootTransform, const struct XRECT_WH & subrectWithPadding, const struct XPOINTF & subtreeToSubrectTranslation, struct IPALAcceleratedSurfaceRenderTarget * pSurfaceRenderTarget);
protected: 
	HRESULT NWGetProjectionTransformer(CPerspectiveTransformer * * ppTransformer);
	virtual XBOOL NWCanApplyOpacityWithoutLayer();
	virtual XBOOL NWAreEdgesDirty(const struct NWRenderParams & rp);
	virtual HRESULT NWRenderPreChildrenEdgesVirtual(const struct SharedRenderParams & sharedRP, const struct NWRenderParams & renderParams, xvector<xref_ptr<CRasterizerEdgeStore> > & vecEdgeStores);
	virtual HRESULT NWRenderPostChildrenEdgesVirtual(const struct SharedRenderParams & sharedRP, const struct NWRenderParams & renderParams, xvector<xref_ptr<CRasterizerEdgeStore> > & vecEdgeStores);
	virtual HRESULT NWRenderChildren(const struct SharedRenderParams & sharedRP, const struct NWRenderParams & nwRP);
	virtual void NWPropagateDirtyFlag(enum DirtyFlags::Value flags);
	void NWSetDirtyFlagsAndPropagate(enum DirtyFlags::Value flags, XUINT32 renderConditionFlag);
	void NWSetDirtyFlagsFromChildAndPropagate(enum DirtyFlags::Value flags, XUINT32 renderConditionFlag);
public: 
	virtual XBOOL NWIsContentDirty();
protected: 
	virtual void EnsureContentRenderDataVirtual(enum RenderWalkType oldType, enum RenderWalkType newType);
	virtual void NWCleanDirtyFlags();
	HRESULT EnsurePropertyRenderData(enum RenderWalkType walkType);
	HRESULT EnsureContentRenderData(enum RenderWalkType newType);
private: 
	XBOOL NWShouldAddEdges(const struct NWRenderParams & nwRP);
	HRESULT D2DPreRenderRecursive(struct D2DPrecomputeParams & d2dPP, const CMILMatrix * pParentAccumulatedTransform, XUINT32 applyProperties);
	HRESULT D2DRenderRecursive(const struct SharedRenderParams & parentSharedRP, const struct D2DRenderParams & parentD2DRP, XUINT32 applyProperties);
	void NWClean();
	XBOOL NWNeedsRenderingInnerProjection();
	XBOOL NWNeedsRenderingOuterCacheMode();
	XBOOL PCArePropertiesDirty();
	XBOOL PCIsCacheModeDirty();
	XBOOL PCIsSubgraphDirty();
	XBOOL PCHasTransformAnimationDirty();
	XBOOL PCHasOpacityAnimationDirty();
	XBOOL PCHasCompositionNodeDirty();
	HRESULT NWRenderPreChildrenEdges(const struct SharedRenderParams & sharedRP, const struct NWRenderParams & nwRP);
	HRESULT NWRenderPostChildrenEdges(const struct SharedRenderParams & sharedRP, const struct NWRenderParams & nwRP);
	HRESULT NWSetUpOpacityAndOpacityMask(struct SharedRenderParams & sharedRP, struct NWRenderParams & nwRP);
	HRESULT NWDrawOpacityAndOpacityMask(const struct SharedRenderParams & sharedRP, const struct NWRenderParams & nwRP);
	HRESULT NWSetUpClips(struct SharedRenderParams & sharedRP, struct NWRenderParams & nwRP);
	static HRESULT NWSetUpClipHelper(struct SharedRenderParams & sharedRP, struct NWRenderParams & nwRP, CGeometry * pClip, XBOOL fIsClipDirty, XBOOL fHadClipLastFrame);
	HRESULT NWDrawClips(struct NWRenderParams & rp, XBOOL fWasTransformDirtyBeforeClip);
	static HRESULT NWDrawClipHelper(CGeometry * pClip, XBOOL fWasTransformDirtyBeforeClip, XBOOL fHadClipLastFrame, XBOOL fIsLayerSharedBetweenVectorBuffers, XBOOL fIsLastCallForFrame, XBOOL fUpdateLayerWithoutAdding, struct NWRenderParams & rp);
	HRESULT NWSetUpProjection(struct SharedRenderParams & sharedRP, struct NWRenderParams & nwRP, XUINT32 & fRenderContents, XBOOL & fRebuildProjection);
	HRESULT NWDrawProjection(struct SharedRenderParams & sharedRP, struct NWRenderParams & nwRP, XUINT32 fRenderContents, XBOOL fRebuildProjection, XBOOL fOuterProjectionTransformDirty);
public: 
	HRESULT Print(const struct SharedRenderParams & sharedPrintParams, const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams);
protected: 
	virtual HRESULT PreChildrenPrintVirtual(const struct SharedRenderParams & sharedPrintParams, const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams);
	virtual HRESULT PrintChildren(const struct SharedRenderParams & sharedPrintParams, const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams); 
	virtual HRESULT PostChildrenPrintVirtual(const struct SharedRenderParams & sharedPrintParams, const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams);
private: 
	HRESULT PrintTransformed(const struct SharedRenderParams & sharedPrintParams, const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams);
private: 
	HRESULT PrintPushClips(const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams, XUINT32 * pPushedClip, XUINT32 * pPushedLayoutClip);
	HRESULT PrintPopClips(const struct D2DRenderParams & printParams, XBOOL fPushedClip, XBOOL fPushedLayoutClip);
	HRESULT PrintPushOpacity(const struct D2DRenderParams & printParams);
	HRESULT PrintPopOpacity(const struct D2DRenderParams & printParams);
protected: 
	virtual HRESULT CreateDirectManipulationContainerHandler(struct IDirectManipulationContainerHandler * * ppDirectManipulationContainerHandler, CInputManager * pInputManager);
	HRESULT OnAlignmentChanged(XBOOL fIsForHorizontalAlignment);
public: 
	virtual HRESULT CreateDirectManipulationContainer(CInputManager * pInputManager);
	virtual HRESULT ReleaseDirectManipulationContainer();
	HRESULT GetDirectManipulationContainer(struct IDirectManipulationContainer * * ppDirectManipulationContainer);
	struct DirectManipulationInfo * GetStaticDMInfo();
	HRESULT SetStaticDMInfo(XFLOAT translationX, XFLOAT translationY, XFLOAT zoomFactor);
	HRESULT GetDirectManipulationTransform(XBOOL fIsForCompositorTreeNode, XBOOL & fTransformSet, XFLOAT & translationX, XFLOAT & translationY, XFLOAT & zoomFactor);
	HRESULT GetDirectManipulationTransform(XBOOL fIsForCompositorTreeNode, XBOOL & fTransformSet, XFLOAT & translationX, XFLOAT & translationY, XFLOAT & zoomFactor, XFLOAT & offsetX, XFLOAT & offsetY, XFLOAT & offsetZoomX, XFLOAT & offsetZoomY);
	void SetIsDirectManipulationCrossSlideContainer(XBOOL isDMCrossSlideContainer);
	XBOOL GetIsDirectManipulationCrossSlideContainer() const;
	void SetIsDirectManipulationContainer(XBOOL isDMContainer);
	XBOOL GetIsDirectManipulationContainer() const;
	void GetCumulativeTransform(CMILMatrix * pLocalTransform, const CMILMatrix * * ppCumulativeTransform);
	static HRESULT D2DSetUpClipHelper(struct IPALAcceleratedRenderTarget * pD2DRenderTarget, XUINT32 pushAxisAlignedClip, struct IPALAcceleratedGeometry * pAcceleratedClipGeometry, const struct XRECTF_RB * pContentBounds, XUINT32 * pPushedClipLayer, XUINT32 * pPushedAxisAlignedClip, XBOOL * pIsClipEmpty);
	static HRESULT D2DPopClipHelper(struct IPALAcceleratedRenderTarget * pD2DRenderTarget, XUINT32 pushedClipLayer, XUINT32 pushedAxisAlignedClip);
protected: 
	virtual HRESULT D2DEnsureResources(const struct D2DPrecomputeParams & cp, const CMILMatrix * pMyAccumulatedTransform);
	virtual HRESULT D2DComputeInnerBounds(struct XRECTF_RB * pInnerBounds);
	HRESULT D2DSetUpClip(struct IPALAcceleratedRenderTarget * pD2DRenderTarget, const CMILMatrix * pWorldTransform, XUINT32 * pPushedClipLayer, XUINT32 * pPushedAxisAlignedClip, XBOOL * pIsClipEmpty, XUINT32 * pPushedLayoutClipLayer, XUINT32 * pPushedAxisAlignedLayoutClip, XBOOL * pIsLayoutClipEmpty);
	HRESULT D2DSetUpOpacity(struct D2DRenderParams & d2dRP, XBOOL * pHasZeroOpacity, XUINT32 * pPushedOpacityLayer);
	HRESULT D2DPopOpacity(struct IPALAcceleratedRenderTarget * pD2DRenderTarget, XUINT32 pushedOpacityLayer);
	HRESULT D2DPopClips(struct IPALAcceleratedRenderTarget * pD2DRenderTarget, XUINT32 pushedClipLayer, XUINT32 pushedAxisAlignedClip, XUINT32 pushedLayoutClipLayer, XUINT32 pushedAxisAlignedLayoutClip);
	virtual HRESULT D2DPreChildrenRenderVirtual(const struct SharedRenderParams & sharedRP, const struct D2DRenderParams & d2dRP);
	virtual HRESULT D2DPostChildrenRenderVirtual(const struct SharedRenderParams & sharedRP, const struct D2DRenderParams & d2dRP);
	virtual HRESULT D2DHitTestSelf(struct XPOINTF ptHit, CUIElement * * ppResult);
private: 
	HRESULT D2DUpdateBounds(const struct D2DPrecomputeParams &, const struct XRECTF_RB *);
private: 
	XBOOL D2DIsRenderDirty();
public: 
	static HRESULT EnsureLayoutTransitionStorage(CDependencyObject * pObject, CDependencyProperty * pDp, XBOOL forGetValue);
	XBOOL HasLayoutTransitionStorage();
	LayoutTransitionStorage * GetLayoutTransitionStorage();

	virtual CTransitionCollection * GetTransitionsForChildElementNoAddRef(CUIElement * pChild);
	XBOOL GetIsLayoutTransitionDirty();
	void SetIsLayoutTransitionDirty(XBOOL value);
	XBOOL GetIsLayoutTransitionDirtyPending();
	void SetIsLayoutTransitionDirtyPending(XBOOL);
	XBOOL GetIsOnLayoutTransitionDirtyPath();
	void SetIsOnLayoutTransitionDirtyPath(XBOOL value);
	XBOOL GetIsOnLayoutTransitionStack();
	void SetIsOnLayoutTransitionStack(XBOOL value);
	XBOOL GetRequiresLayoutTransition();
	HRESULT TransitionLayout(CUIElement * pRoot, struct XRECTF_WH rootRect);
	HRESULT OnAssociationFailure();
	HRESULT GetTouchInteractionElement(struct IXcpTouchInteractionElement * * ppTouchInteractionElement);
	HRESULT GetTouchInteraction(XBOOL fManipulationOnly, struct IPALTouchInteraction * * ppTouchInteraction);
	HRESULT GetCurrentTouchInteraction(struct IPALTouchInteraction * * ppTouchInteraction);
	void DestroyTouchInteraction();
	HRESULT SetTouchInteraction(struct IPALTouchInteraction * pNewInteractionContext, XBOOL fManipulationOnly);
	void TouchInteractionCallback(struct TouchInteractionMsg * pMessage);
	XBOOL HWIsCached();
	XBOOL ShouldRasterizeWithD2D();
	XBOOL HasIndependentAnimationsOrManipulations();
	XBOOL RequiresCompositionNode();
	XBOOL RequiresBrushClones();
	XBOOL IsTransformOrProjectionIndependentlyAnimating();
	XBOOL IsOpacityIndependentlyAnimating();
	XBOOL IsClipIndependentlyAnimating();
	XBOOL IsBrushIndependentlyAnimating();
	XBOOL IsManipulatedIndependently();
	XBOOL IsRenderWalkRoot();
	XBOOL IsRedirectionElement();
	XBOOL IsFrameServerElement();
	XBOOL RequiresComposition();
	void SetRequiresComposition(enum IndependentAnimationType::Value isForAnimation, XBOOL isForManipulation, XBOOL isRootElement, XBOOL isRedirectionElement, XBOOL isFrameServerElement);
	void UnsetRequiresComposition(enum IndependentAnimationType::Value isForAnimation, XBOOL isForManipulation, XBOOL isRootElement, XBOOL isRedirectionElement, XBOOL isFrameServerElement);
	XBOOL IsOnCompositionPath();
	XINT32 GetCompositionPathCounter() const;
	XUINT32 GetUnloadingChildrenCompositionPathCounter();
	void PropagateCompositionPathChange(XINT32 delta);
	void PropagateCompositionPathChangeToParent(XINT32 delta, CUIElement * pParent);
	void AttachCompositionPath(CUIElement * pParent);
	void DetachCompositionPath(CUIElement * pParent);
	HWRealization * GetHWRealizationCache();
	void SetHWRealizationCache(HWRealization * pNewRenderingCache);
	virtual void ClearPCRenderData();
	HRESULT GetPCPreChildrenRenderDataNoRef(xvector<HWInstance *> * * ppRenderData);
	HRESULT GetPCPostChildrenRenderDataNoRef(xvector<HWInstance *> * * ppRenderData);
	virtual void GetIndependentlyAnimatedBrushes(CSolidColorBrush * * ppFillBrush, CSolidColorBrush * * ppStrokeBrush);
	void EnterPCScene();
	XBOOL IsInPCScene();
	HRESULT LeavePCSceneRecursive();
	void StoreLastInstance(HWInstance * pInstance);
	HWInstance * GetLastInstance();
	void SetWasRedirectedTransformAnimating(XBOOL wasRedirectedTransformAnimating);
	XBOOL GetWasRedirectedTransformAnimating();
private: 
	virtual HRESULT LeavePCSceneSubgraph();
private: 
	virtual CUIElement * GetCompositionPathParent();
public: 

	HRESULT GetInnerBounds(struct XRECTF_RB * pBounds);
	HRESULT GetContentInnerBounds(struct XRECTF_RB * pBounds);
	HRESULT GetOuterBounds(struct XRECTF_RB * pBounds);
	HRESULT GetGlobalBounds(struct XRECTF_RB * pBounds, XBOOL ignoreClipping);
	HRESULT GetVisibleImageBrushBounds(CImageBrush * pImageBrush, const struct XRECTF_RB * pWindowBounds, struct XRECTF_WH * pBounds);
	static HRESULT TransformOuterToInnerChain(CUIElement * pStartElement, CUIElement * pStopElement, const struct XPOINTF * pOuterPoints, struct XPOINTF * pInnerPoints, XUINT32 numPoints, XUINT32 * pTransformedPoints);
	static HRESULT TransformInnerToOuterChain(CUIElement * pStartElement, CUIElement * pStopElement, const struct XRECTF_RB * pInnerRect, struct XRECTF_RB * pOuterRect, XBOOL ignoreClipping);
	void InvalidateChildBounds();
	virtual HRESULT BoundsTestInternal(const HitTestPolygon & target, struct IBoundsTestCallback * pCallback, enum BoundsWalkHitResult::Value * pResult);
	virtual HRESULT BoundsTestInternal(const struct XPOINTF & target, struct IBoundsTestCallback * pCallback, enum BoundsWalkHitResult::Value * pResult);
protected: 
	HRESULT EnsureInnerBounds();
	virtual HRESULT GenerateContentBounds(struct XRECTF_RB * pBounds);
	virtual HRESULT GenerateChildOuterBounds(struct XRECTF_RB * pBounds);
	virtual HRESULT BoundsTestChildren(const HitTestPolygon & target, struct IBoundsTestCallback * pCallback, enum BoundsWalkHitResult::Value * pResult);
	virtual HRESULT BoundsTestChildren(const struct XPOINTF & target, struct IBoundsTestCallback * pCallback, enum BoundsWalkHitResult::Value * pResult);
	HRESULT TransformOuterToInner(const struct XPOINTF * pOuterPoints, struct XPOINTF * pInnerPoints, XUINT32 numPoints, XUINT32 * pTransformedPoints);
	HRESULT TransformInnerToOuter(const struct XRECTF_RB * pInnerBounds, struct XRECTF_RB * pOuterBounds, XBOOL ignoreClipping);
	HRESULT TransformInnerToOuter(const struct XPOINTF * pInnerPoints, struct XPOINTF * pOuterPoints, XUINT32 numPoints, XBOOL * pAreAllWValuesPositive);
	virtual HRESULT HitTestLocalInternal(const HitTestPolygon & target, XBOOL * pHit);
	virtual HRESULT HitTestLocalInternal(const struct XPOINTF & target, XBOOL * pHit);
	virtual HRESULT GetBoundsForImageBrushVirtual(const CImageBrush * __formal, struct XRECTF_WH * pBounds);
private: 
	HRESULT GetOuterBoundsAsQuad(XUINT32 * pPointCount, struct XPOINTF * pOuterQuad);
	HRESULT ApplyClipsToBounds(struct XRECTF_RB * pBounds);
	XBOOL AreBoundsDirty();
	XBOOL AreInnerBoundsDirty();
	XBOOL AreOuterBoundsDirty();
	XBOOL AreContentInnerBoundsDirty();
	XBOOL AreChildBoundsDirty();
	void CleanOuterBounds();
	void CleanContentInnerBounds();
	void CleanChildBounds();
	void CleanInnerBounds();
	void InvalidateElementBounds();
	HRESULT EnsureOuterBounds();
	HRESULT EnsureContentInnerBounds();
	HRESULT EnsureChildBounds();

protected: 
	virtual HRESULT OnKeyUp(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnKeyUp(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnKeyDown(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnKeyDown(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnGotFocus(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnGotFocus(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnLostFocus(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnLostFocus(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnIsEnabledChanged(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnIsEnabledChanged(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnInheritedPropertyChanged(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnInheritedPropertyChanged(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnCharacterReceived(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnCharacterReceived(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnDragEnter(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnDragEnter(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnDragLeave(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnDragLeave(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnDragOver(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnDragOver(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnDrop(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnDrop(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerEntered(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerEntered(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerPressed(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerPressed(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerMoved(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerMoved(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerReleased(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerReleased(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerExited(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerExited(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerCaptureLost(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerCaptureLost(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerCanceled(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerCanceled(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnPointerWheelChanged(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnPointerWheelChanged(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnTapped(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnTapped(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnDoubleTapped(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnDoubleTapped(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnHolding(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnHolding(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnRightTapped(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnRightTapped(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnRightTappedUnhandled(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnRightTappedUnhandled(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnManipulationStarting(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnManipulationStarting(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnManipulationInertiaStarting(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnManipulationInertiaStarting(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnManipulationStarted(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnManipulationStarted(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnManipulationDelta(struct Xcp_IDependencyObject * pEventArgs);
public: 
	static HRESULT OnManipulationDelta(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
protected: 
	virtual HRESULT OnManipulationCompleted(struct Xcp_IDependencyObject * pEventArgs);
public: static HRESULT OnManipulationCompleted(struct Xcp_IDependencyObject * pSender, struct Xcp_IDependencyObject * pEventArgs);
		typedef HRESULT (__stdcall *const * const PFNDelegate)(struct Xcp_IDependencyObject *, struct Xcp_IDependencyObject *);
public: 
	static  const PFNDelegate Delegates[29];
public: 
	static const XUINT16 * CLREventNames[29];
public: 
	static XBOOL IsValidDelegate(XUINT32 nDelegate);
protected: 
	virtual HRESULT OnLostMouseCapture(struct Xcp_IDependencyObject * pEventArgs);
public: 


	XUINT32 m_uiManipulationMode;
	CTransitionTarget * m_pTransitionTarget;
	CTransitionCollection * m_pTransitions;
	CPointerCollection * m_pPointerCaptures;
	XFLOAT m_eOffsetX;
	XFLOAT m_eOffsetY;
	XINT32 m_nZIndex;
	CTriggerCollection * m_pTriggers;
	TextFormatting * m_pTextFormatting;
	struct AutomationProperties * m_pAutomationProperties;
	LayoutTransitionStorage * m_pLayoutTransitionStorage;
	XUINT16 m_enteredTreeCounter:16; 
	XUINT16 m_leftTreeCounter:16;
protected: 
	struct Xcp_IAutomationPeer * m_pAP;
	struct ContentRenderData m_contentRenderData;

protected: 
	XBOOL m_isRightToLeftGeneration;
	XBOOL m_isRightToLeft:1;
private: 
	XBOOL m_fVisibility:1;
	XBOOL m_fHitTestVisible:1;
	XBOOL m_fAllowDrop:1;
	XBOOL m_bTapEnabled:1;
	XBOOL m_bDoubleTapEnabled:1;
	XBOOL m_bRightTapEnabled:1;
	XBOOL m_bHoldEnabled:1;
	XBOOL m_fIsEnabled:1;
	XBOOL m_fCoercedIsEnabled:1;
	XBOOL m_fUseLayoutRounding:1;
	XBOOL m_fNWVisibilityDirty:1;
	XBOOL m_fNWTransformDirty:1;
	XBOOL m_fNWProjectionDirty:1;
	XBOOL m_fNWClipDirty:1;
	XBOOL m_fNWOpacityDirty:1;
	XBOOL m_fNWCacheModeDirty:1;
	XBOOL m_fNWContentDirty:1;
	XBOOL m_fNWSubgraphDirty:1;
	XBOOL m_fNWHadUserClip:1;
	XBOOL m_fNWHadLayoutClip:1;
	XBOOL m_fNWLayoutClipDirty:1;
	XBOOL m_fNWHasTransformAnimationDirty:1;
	XBOOL m_fNWHasOpacityAnimationDirty:1;
	XBOOL m_fNWHasCompNodeDirty:1;
	XBOOL m_hasTransformOrProjectionIA:1;
	XBOOL m_hasOpacityIA:1;
	XBOOL m_hasClipIA:1;
	XBOOL m_hasBrushColorIA:1;
	XBOOL m_hasManipulation:1;
	XBOOL m_isRootElement:1;
	XBOOL m_isRedirectionElement:1;
	XBOOL m_isFrameServerElement:1;
	XBOOL m_fIsDirectManipulationCrossSlideContainer:1;
	XBOOL m_fIsDirectManipulationContainer:1;
	XBOOL m_contentInnerboundsDirty:1;
	XBOOL m_childBoundsDirty:1;
	XBOOL m_combinedInnerBoundsDirty:1;
	XBOOL m_outerBoundsDirty:1;
	XBOOL m_skipFocusSubtree:1;
private: 
	struct XRECTF_RB m_contentInnerBounds;

	struct XRECTF_RB m_childBounds;


	struct XRECTF_RB m_combinedInnerBounds;


	struct XRECTF_RB m_outerBounds;

	struct PropertyRenderData m_propertyRenderData;

private: 
	XINT32 m_compositionPathCounter;
	XUINT32 m_layoutFlags;
	CLayoutStorage * m_pLayoutStorage;
	CUIElementCollection * m_pChildren;
	xvector<CLayoutTransitionElement *> * m_pLayoutTransitionRenderers;
	xvector<xref_ptr<CRasterizerEdgeStore> > * m_pVecEdgeStores;
	xvector<xref_ptr<CRasterizerEdgeStore> > * m_pVecPostChildrenEdgeStores;
	struct DirectManipulationInfo * m_pStaticDMInfo;
	struct IDirectManipulationContainer * m_pDirectManipulationContainer;
	struct IPALTouchInteraction * m_pTouchInteraction;
	struct IXcpTouchInteractionElement * m_pTouchInteractionElement;



};

